// pages/my/my.js
Page({
  data: {
    url:'',
    price:'',
    nickName:'',
    avatarUrl:''
  },
  onLoad: function (options) {
    let url = options.url,
    price = options.price

    var that = this
    this.setData({
      url,
      price
    })
    wx.getUserInfo({
      success(res){
        console.log(res.userInfo)
        that.setData({
          nickName:res.userInfo.nickName,
          avatarUrl:res.userInfo.avatarUrl
        })
      }
    })
  },
  back(){
    wx.showModal({
      title: '确认返回卖货首页吗？',
      content: '购物车内本单商品将被清空',
      success: function(res) {
        if (res.confirm) {
          wx.switchTab({
            url:'stock'
          })
        } else if (res.cancel) {
          console.log('用户点击取消')
        }
      }
    })
  }

})